#!/usr/bin/env bash

set -e
CODE_PATH=`pwd`

IP=192.168.1.16
USER=dig
DEPLOY_PATH=/data/dfs/dn/1/ware/bigdata/etl_dap/ODM/shell

echo "当前更新代码路径: ${CODE_PATH}"


for item in `ls`
do
    if [ "${item}" = "deploy.sh" ]; then
        continue
    fi

    if [ -d ${item} ];then
        echo "当前文件是文件夹，不进行部署: ${item}"
        continue
    fi

    scp ${item} ${USER}@${IP}:${DEPLOY_PATH}
    echo "当前部署完成脚本: ${DEPLOY_PATH}/${item}"
done

echo "代码更新完成"